import http from '../../utils/http'
// 获取教师课程首页
export const getMyCourseIndex = (data:{
  endDate:string,
  startDate:string
})=>{
  return http({
    method:"GET",
    url:"/teacher/lesson/listByDate",
    data
  })
}
// 获取教师课程详情
export const getTeacherCourseDetail = (data:{
  lessonId:number
})=>{
  return http({
    method:"GET",
    url:"/teacher/lesson/lessonDetails",
    data
  })
}
// 获取教师课程列表
export const getTeacherCourseList = (data:{
  pageNum?:number,
  pageSize?:number,
  state?:number
})=>{
  return http({
    method:"GET",
    url:"/teacher/course/myCourseList",
    data
  })
}

// 获取上课记录
export const getCourseRecord = (data:{
  pageNum?:number,
  pageSize?:number,
})=>{
  return http({
    method:"GET",
    url:"/teacher/course/courseRecord",
    data
  })
}
// 解码二维码获取学生上课列表
export const decodeSingCode = (data:{
  resultStr:string
})=>{
  return http({
    header:{
      'content-type':'multipart/form-data; boundary=XXX'
    },
    method:"POST",
    url:`/teacher/instructor/decodeSingCode`,
    data:'\r\n--XXX' +
    '\r\nContent-Disposition: form-data; name="resultStr"' +
    '\r\n' +
    '\r\n' +  data.resultStr + '\r\n--XXX'
  })
}
// 去销课
export const consumptionLesson = (data:{
  lessonId:number,
  stuId:number
})=>{
  return http({
    header:{
      'content-type':'multipart/form-data; boundary=XXX'
    },
    method:"POST",
    url:`/teacher/instructor/consumptionLesson`,
    data:'\r\n--XXX' +
    '\r\nContent-Disposition: form-data; name="lessonId"' +
    '\r\n' +
    '\r\n' +  data.lessonId + '\r\n--XXX' + 
    '\r\n--XXX' +
    '\r\nContent-Disposition: form-data; name="stuId"' +
    '\r\n' +
    '\r\n' +  data.stuId + '\r\n--XXX'
  })
}
// 获取课时id
export const selectLearnersByLesson = (data:{
  lessonId:number
})=>{
  return http({
    method:"GET",
    url:"/teacher/lesson/selectLearnersByLesson",
    data
  })
}




